﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BestBuy.UserControls
{
    public partial class TimeCountDown : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                TimeCountDownContainer.Visible = false;
            }
        }

        public double seconds;
        public void CountDown(DateTime EndTime)
        {
            seconds = 0;
            if (EndTime <= DateTime.Now)
                return;
            seconds = (EndTime - DateTime.Now).TotalSeconds;
            TimeCountDownContainer.Visible = true;
        }
    }
}